from django.urls import path
from django.urls import re_path
from baseinfo import views
from django.views.generic.base import RedirectView

urlpatterns = [
    # 首页
    path('', views.index, name='index'),


    path('crawler/', views.crawler, name='crawler'),

    # favicon.cio
    path(r'favicon.ico', RedirectView.as_view(url=r'static/images/favicon.ico')),

    # 根据当前页获取数据
    re_path('detail/page/(?P<current_page>\d+)/pagesize/(?P<page_size>\d+)', views.get_detail_data_by_page, name='page'),

    # 获取行情分析
    path('info/', views.get_info, name='page'),

    # 获取市场信息
    path('marketinfo/', views.get_market_info, name='page'),

    # 查询历史价格
    path('search/', views.search, name='search'),

    # 今日行情
    re_path('today/(?P<market_id>\d+)', views.get_today_by_market_id, name='today'),
]